Every movie has default, or preferred, settings for playback rate and volume. These settings are stored with the movie in its movie file. The Movie Toolbox provides functions that allow your application to manipulate these default settings.
You can use the GetMoviePreferredRate and SetMoviePreferredRate functions to work with a movie's default playback rate. You can use the GetMoviePreferredVolume and SetMoviePreferredVolume functions to work with the default sound volume of a movie.
You can use the SetMovieRate function to change a movie's playback rate--see "Working with Movie Time," for a complete description of this function. The Movie Toolbox also provides a number of functions that allow you to change other settings when you play a movie. These functions are discussed in "Functions That Modify Movie Properties," .
The SetMoviePreferredRate function allows your application to specify a movie's default playback rate.
pascal void SetMoviePreferredRate (Movie theMovie, Fixed rate);
The default playback rate is the rate that the StartMovie function (described on StartMovie ) uses when it starts playing a movie. The default preferred rate of a movie is set to 1.0 (the kFix1 constant) when the movie is created.
Your application can obtain the preferred playback rate by calling the GetMoviePreferredRate function, which is described in the next section.
You can set the current playback rate of a movie by calling the SetMovieRate function, which is described on SetMovieRate .
The GetMoviePreferredRate function returns a movie's default playback rate. This is the rate that the StartMovie function uses when it starts playing a movie.
pascal Fixed GetMoviePreferredRate (Movie theMovie);
The GetMoviePreferredRate function returns the default movie rate as a 32-bit, fixed-point number. Positive integers indicate forward rates and negative integers indicate reverse rates.
Your application can change the preferred playback rate by calling the SetMoviePreferredRate function, which is described in the previous section. You can change the current playback rate of a movie by calling the SetMovieRate function, which is described on SetMovieRate .
The SetMoviePreferredVolume function allows your application to set a movie's preferred volume setting.
pascal void SetMoviePreferredVolume (Movie theMovie,
short volume);
Your application can obtain the preferred volume setting by calling the GetMoviePreferredVolume function, which is described in the next section. You can change a movie's current volume by calling the SetMovieVolume function, which is described on SetMovieVolume .
A movie's tracks may have their own volume settings. Use the SetTrackVolume function, described on SetTrackVolume , to set the volume of an individual track. A track's volume is scaled by the movie's volume to produce the track's final volume. Furthermore, the movie's volume is scaled by the sound volume that is returned by the Operating System's GetSoundVol routine (described in Inside Macintosh: More Macintosh Toolbox ). Thus, the user can control the overall volume from the Sound control panel.
When a movie is loaded, the current setting is set to preferred volume. The StartMovie function (described on StartMovie ) uses this volume setting when it starts playing a movie.
The GetMoviePreferredVolume function returns a movie's preferred volume setting.
pascal short GetMoviePreferredVolume (Movie theMovie);
The GetMoviePreferredVolume function returns a 16-bit, fixed-point number that contains the movie's default volume. The high-order 8 bits contain the integer part of the value; the low-order 8 bits contain the fractional part. Volume values range from 0.0 to 1.0.
You can change a movie's current volume by calling the SetMovieVolume function, which is described on SetMovieVolume .
A movie's tracks have their own volume settings. Use the SetTrackVolume function, described on SetTrackVolume , to set the volume of an individual track. A track's volume is scaled by the movie's volume to produce the track's final volume. Furthermore, the movie's volume is scaled by the sound volume that is returned by the Operating System's GetSoundVol routine (described in Inside Macintosh: More Macintosh Toolbox ). Thus, the user can control the overall volume from the Sound control panel.
When a movie is loaded, the current setting is set to preferred volume. The StartMovie function (described on StartMovie ) uses this volume setting when it starts playing a movie.